package Banco;

import Class.User;
import dataBase.conexao;
import java.sql.Connection;
import java.sql.SQLException;

public class Updates {
    public void update_user (User u) throws SQLException{
        Connection c = null;
        conexao connect = new conexao();
        c = connect.getConnection();
        java.sql.Statement stm = c.createStatement();        
        String nome = u.getNome();
        Integer senha = u.getSenha();
        String id = u.getId();
        String sql = "UPDATE helpdeskweb.user SET ";
               sql += " nome = ";
               sql += "'" +(nome)+"',";
               sql += " senha = ";
               sql += "" +(senha)+"";
               sql += " WHERE id = ";
               sql += "'" +(id)+"'";
               sql += "";
        stm.executeUpdate(sql);              
        c.close();
    }
}
